import React, {memo} from 'react';
import { useMyHook } from "./hooks";

const Home = memo(() => {
  const { value, onChange } = useMyHook('夜斗')
  return (
    <div>
      <h2>Home</h2>
      <p>value:{value}</p>
      <input value={value} onChange={onChange} />
    </div>
  )
})

const About = memo(() => {
  const { value, onChange } = useMyHook('李永琪')
  return (
      <div>
        <h2>About</h2>
        <p>value:{value}</p>
        <input value={value} onChange={onChange} />
      </div>
  )
})

const App = memo(() => {
  return (
      <div>
        <h1>App</h1>
        <Home/>
        <About/>
      </div>
  );
});

export default App;